package com.hgw.Demo04_CreateInterator.Exercises19_8_4;

import java.util.ArrayList;
import java.util.List;

/**
 * Data time:2021/12/18 13:52
 * StudentID:2019112118
 * Author:hgw
 * Description: 电视频道集合，抽象聚合类
 */
public abstract class AbstractTCList {
    protected List<TC> tcList = new ArrayList<TC>();

    public AbstractTCList(List<TC> tcList) {
        this.tcList = tcList;
    }

    // 增加电视频道
    public void addTC(TC tc) {
        this.tcList.add(tc);
    }

    // 删除电视频道
    public void removeTC(TC tc) {
        this.tcList.remove(tc);
    }

    // 获取所有电视频道
    public List<TC> getTcList() {
        return this.tcList;
    }

    // 声明创建迭代器对象的抽象方法
    public abstract AbstractTCListIterator createTCListIterator();
}
